<?php

use yii\helpers\Html;
use yak\layui\widgets\form\ActiveForm;

/* @var $this yii\web\View */
/* @var $model yak\layui\models\admin\User */
/* @var $form yii\widgets\ActiveForm */
/* @var $ajaxOptions array */
?>

<div class="admin-form form-block">

    <?php $form = ActiveForm::begin(['ajaxOptions' => $ajaxOptions]); ?>

    <?= $form->field($model, 'auth_key', ['template' => '{input}'])->hiddenInput()->label(false) ?>
    <?= $form->field($model, 'password_hash', ['template' => '{input}'])->hiddenInput()->label(false) ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => true, 'lay-verify' => 'required']) ?>

    <?php // $form->field($model, 'avatar')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'username')->textInput(['maxlength' => true, 'lay-verify' => 'required']) ?>

    <?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'status')->radioList($model->statusLabels()) ?>

    <?= $form->field($model, 'type')->radioList($model->typeLabels()) ?>

    <div class="layui-form-item layui-input-block">
        <?= Html::submitButton('立即提交', [
            'class' => 'layui-btn', 'lay-submit' => true, 'lay-filter' => '_SUBMIT_FORM'
        ]) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
